YARN-11226. [Federation] Add createNewReservation, submitReservation, updateReservation, deleteReservation REST APIs for Router.#4892
Conversation
…Reservation, updateReservation, deleteReservation REST APIs for Router.
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
| interceptor.getOrCreateInterceptorForSubCluster( | ||
| subCluster, subClusterInfo.getRMWebServiceAddress()); | ||
| } | ||
| } catch (YarnException e) { |
There was a problem hiding this comment.
Why isn't enough to surface the exception?
There was a problem hiding this comment.
Thanks for your help reviewing the code, I will fix it.
|
|
||
| try { | ||
| interceptor.setupResourceManager(); | ||
| } catch (Exception e) { |
There was a problem hiding this comment.
Surfacing the exception would be enough
| // Define default queue | ||
| conf.setCapacity(QUEUE_DEFAULT_FULL, 20); | ||
| // Define dedicated queues | ||
| conf.setQueues(CapacitySchedulerConfiguration.ROOT, |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri Please help to review the code again, thank you very much! |
|
🎊 +1 overall
This message was automatically generated. |
| * @param reservationId reservationId | ||
| * @return true - exist, false - not exist | ||
| */ | ||
| public static Boolean existsReservationHomeSubCluster(FederationStateStoreFacade federationFacade, |
There was a problem hiding this comment.
can this be the native boolean type?
There was a problem hiding this comment.
Thanks for your help reviewing the code, I will modify the code.
| ClientRMService clientService = mockRM.getClientRMService(); | ||
| clientService.updateReservation(request); | ||
|
|
||
| } catch (Exception ex) { |
There was a problem hiding this comment.
This is a fairly broad catch, wouldn't it be better to just throw the exceptions?
There was a problem hiding this comment.
I agree with you, I will modify the code.
|
|
||
| ReservationRequestsInfo resReqsInfo = resInfo.getReservationRequests(); | ||
| if (resReqsInfo == null || resReqsInfo.getReservationRequest() == null | ||
| || resReqsInfo.getReservationRequest().size() == 0) { |
| ReservationId reservationId, int numContainers, long arrival, | ||
| long deadline, long duration, int memory, int vcore) { | ||
| // create a request with a single atomic ask | ||
| ReservationRequest r = ReservationRequest |
There was a problem hiding this comment.
Small nit, this would look better as:
ReservationRequest r = ReservationRequest.newInstance(
Resource.newInstance(memory, vcore), numContainers, 1, duration);
There was a problem hiding this comment.
Thanks for the suggestion, I will fix it.
| Collections.singletonList(r), ReservationRequestInterpreter.R_ALL); | ||
| ReservationDefinition rDef = ReservationDefinition.newInstance(arrival, | ||
| deadline, reqs, "testClientRMService#reservation", "0", Priority.UNDEFINED); | ||
| ReservationSubmissionRequest request = ReservationSubmissionRequest |
|
|
||
| protected void setupResourceManager() throws IOException { | ||
| try { | ||
| if (mockRM != null) { |
There was a problem hiding this comment.
You can move some of this before the try
...test/java/org/apache/hadoop/yarn/server/router/webapp/TestableFederationInterceptorREST.java
Show resolved
Hide resolved
| ReservationRequests reservationRequests = | ||
| ReservationRequests.newInstance(reservationRequestList, reservationRequestInterpreter); | ||
|
|
||
| ReservationDefinition definition = |
...-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/RouterServerUtil.java
Show resolved
Hide resolved
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri Please help to review the code again, thank you very much! |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri Can you help review this pr again? thank you very much! |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri Can you help merge this pr into trunk branch? Thank you very much! I will follow up with YARN-11320. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
JIRA: YARN-11226. [Federation] Add createNewReservation, submitReservation, updateReservation, deleteReservation REST APIs for Router.